package com.dxg.msns.common.pojo;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * 评论实体类
 * 对应数据库表：comment
 * 
 * @author system
 */
@Table(name = "comment")
public class Comment implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 父评论ID
     */
    @Column(name = "pid")
    private Long pid;

    /**
     * 回复评论ID
     */
    @Column(name = "lid")
    private Long lid;

    /**
     * 动态ID
     */
    @Column(name = "dynamic_id")
    private Integer dynamicId;

    /**
     * 回复者ID
     */
    @Column(name = "reply_id")
    private String replyId;

    /**
     * 被评论者ID
     */
    @Column(name = "respondent_id")
    private String respondentId;

    /**
     * 评论日期
     */
    @Column(name = "comment_date")
    private Date commentDate;

    /**
     * 评论内容
     */
    @Column(name = "comment_content")
    private String commentContent;

    /**
     * 状态
     */
    @Column(name = "status")
    private String status;

    /**
     * 音乐ID
     */
    @Column(name = "music_id")
    private String musicId;

    /**
     * 歌单ID
     */
    @Column(name = "playlist_id")
    private String playlistId;

    /**
     * 歌手ID
     */
    @Column(name = "singer_id")
    private String singerId;

    // 构造方法
    public Comment() {
    }

    public Comment(String replyId, String respondentId, String commentContent) {
        this.replyId = replyId;
        this.respondentId = respondentId;
        this.commentContent = commentContent;
        this.commentDate = new Date();
        this.status = "ACTIVE";
    }

    // Getter 和 Setter 方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public Long getLid() {
        return lid;
    }

    public void setLid(Long lid) {
        this.lid = lid;
    }

    public Integer getDynamicId() {
        return dynamicId;
    }

    public void setDynamicId(Integer dynamicId) {
        this.dynamicId = dynamicId;
    }

    public String getReplyId() {
        return replyId;
    }

    public void setReplyId(String replyId) {
        this.replyId = replyId;
    }

    public String getRespondentId() {
        return respondentId;
    }

    public void setRespondentId(String respondentId) {
        this.respondentId = respondentId;
    }

    public Date getCommentDate() {
        return commentDate;
    }

    public void setCommentDate(Date commentDate) {
        this.commentDate = commentDate;
    }

    public String getCommentContent() {
        return commentContent;
    }

    public void setCommentContent(String commentContent) {
        this.commentContent = commentContent;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMusicId() {
        return musicId;
    }

    public void setMusicId(String musicId) {
        this.musicId = musicId;
    }

    public String getPlaylistId() {
        return playlistId;
    }

    public void setPlaylistId(String playlistId) {
        this.playlistId = playlistId;
    }

    public String getSingerId() {
        return singerId;
    }

    public void setSingerId(String singerId) {
        this.singerId = singerId;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", pid=" + pid +
                ", lid=" + lid +
                ", dynamicId=" + dynamicId +
                ", replyId='" + replyId + '\'' +
                ", respondentId='" + respondentId + '\'' +
                ", commentDate=" + commentDate +
                ", commentContent='" + commentContent + '\'' +
                ", status='" + status + '\'' +
                ", musicId='" + musicId + '\'' +
                ", playlistId='" + playlistId + '\'' +
                ", singerId='" + singerId + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Comment comment = (Comment) o;

        return id != null ? id.equals(comment.id) : comment.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}